"use strict";

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    /**
     * Add seed commands here.
     *
     * Example:
     * await queryInterface.bulkInsert('People', [{
     *   name: 'John Doe',
     *   isBetaMember: false
     * }], {});
     */
    await queryInterface.bulkInsert("courses", [
      {
        categoryId: 1,
        userId: 1,
        name: "CSS 入门",
        content: "CSS 是一种样式表语言，用于描述 HTML 文档的外观和格式。",
        recommended: true,
        introductory: true,
        chaptersCount:1,
        createdAt: new Date(),
        updatedAt: new Date(),
      },
      {
        categoryId: 2,
        userId: 1,
        name: "Node.js 项目实践（2024 版）",
        content: "Node.js 是一个基于 Chrome V8 引擎的 JavaScript 运行时，适用于构建高性能的网络应用程序。",
        recommended: true,
        introductory: false,
        chaptersCount:2,
        createdAt: new Date(),
        updatedAt: new Date(),
      },
    ],{});
  },

  async down(queryInterface, Sequelize) {
    /**
     * Add commands to revert seed here.
     *
     * Example:
     * await queryInterface.bulkDelete('People', null, {});
     */
    await queryInterface.bulkDelete("courses", null, {});
  },
};
